﻿using Mengsk.ProxyDelivery.Domain;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Mengsk.ProxyDelivery.Print.Domain.DeliveryNumberGenerator
{
    class STODeliveryNumberGenerator : DeliveryNumberGenerator
    {
        public override bool AcceptDeliveryCompany(string arg)
        {
            return arg.Contains("申通");
        }

        public override string GenenrateNext(string deliveryNumberAlgorithm, string current)
        {
            if (String.IsNullOrWhiteSpace(current) || current.Length != 12)
            {
                throw new Exception("申通快递当前单号不为12位:" + current);
            }

            try
            {
                long l = long.Parse(current);
                l++;
                return l.ToString();
            }
            catch (Exception ex)
            {
                throw new Exception("申通快递单号计算错误:" + current + "," + ex.Message);
            }

        }


        public override string GenenrateOnline( Order order, string wuliuId)
        {
            throw new NotImplementedException();
        }

        public override void CancelOnline( WuliuNumber wuliuNumber)
        {
            throw new NotImplementedException();
        }

        public override string GenenrateWuliuId(params string[] orderIds)
        {
            throw new NotImplementedException();
        }
    }
}
